package com.wkk.quartz.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author : WangKeKe
 * @date : 2020/8/17 16:21
 * Description : 任务实体类
 */

@Data
@Accessors(chain = true)
@TableName("no_quartz")
@ApiModel(description = "定时任务数据库表映射")
public class QuartzJob implements Serializable {

    private static final long serialVersionUID = -123456L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;


    @ApiModelProperty(value = "创建者ID")
    private String createBy;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改人ID")
    private String updateBy;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    @ApiModelProperty(value = "任务类相对路径")
    private String jobClassName;

    @ApiModelProperty(value = "cron表达式")
    private String cronExpression;

    @ApiModelProperty(value = "自定义参数")
    private String parameter;

    @ApiModelProperty(value = "定时任务描述")
    private String description;

    @ApiModelProperty(value = "定时任务状态 0暂停 1启动")
    private Integer status;

    @ApiModelProperty(value = "逻辑删除 0存在 1删除")
    private Integer deleted;

}
